_package("nboxz.page");

_import("caf.ui.Page");

_class("HomePage", Page, function(){
	
	this.config = "config-setting";
	
	this._init = function(){
		_super._init.call(this);
	};
	this.create = function(parent){
		var obj = this.createTplElement(parent, "home.xml");
		this.init(obj);
		return obj;
	};
	this.init = function(){
		_super.init.apply(this, arguments);
		this.initComponents();
		this.initActionElements();
	};
	this.dispose = function(){
		_super.dispose.apply(this);
	};
	 
	// 简单的跳转
	this.do_toSetting = function(e){
		this._app.navPage("setting",{"from" : "我来自" + this._pid + " ；模板是：" + this._tpl, "event" : e});
	};
	
	// 测试ajax取得数据
	this.do_ajax = function(){
		var _this = this,  
		method = 'POST',  
		params = {
		    'key' : 'a70a0c56bc9419d6b3283aa0b1355c0a743754f680f58f44f5e198d88f3d1b9c',  
		    'format' : 'json'  
		},  
		url = 'http://gootle.com/';  
		
		_this._app.netInvoke(method, url, params, 'text', _this, function(result) {  
			
			alert(result);
		   
		});
	};
	
	// 测试本地存储
	this.do_localstorage = function(){
		window.localStorage.setItem("mobileNumber", $("#mobile-number").val() ); //设置  
	};
	
	// 重置
	this.reset = function(o){
		$("#mobile-number").val(window.localStorage.getItem("mobileNumber"));
	};
	
	
});

